The invention is based on an electrically controlled 3-way valve as generically defined herein. A 3-way valve known from U.S. Pat. No. 3,989,063 has an armature, drilled out to form steps inside it, into which stop rings and spacer rings are placed in succession and fixed by bracing. Two closure member holders are located displaceably inside the spacer rings between the stop rings. The mobility of the closure member holders in the axial direction of the armature is limited by the stop rings. Both the valve closing spring located between the closure member holders and the anchor restoring spring are installed with prestressing. At given armature forces for a middle and a final armature position, the forces of the prestressed springs must be at a suitable ratio to one another and to the magnetic forces. Because of unavoidable manufacturing tolerances, the ratio of the spring forces often deviates disadvantageously from the most favorable value. In such cases, a suitable ratio of the forces of the prestressed springs is finally established by replacing the aforementioned rings with others of different heights. Replacing the rings is very time-consuming and therefore has the disadvantage of making the valve more expensive.